namespace Myapp.Models.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class _new : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Users",
                c => new
                    {
                        UserId = c.Int(nullable: false, identity: true),
                        UserFirstName = c.String(maxLength: 50),
                        UserLastName = c.String(maxLength: 50),
                        UserPassword = c.String(maxLength: 50),
                        UserUserName = c.String(maxLength: 50),
                        UserAge = c.Int(nullable: false),
                        UserDateOfBirth = c.DateTime(nullable: false),
                        UserMaritualStatus = c.String(maxLength: 50),
                        UserCity = c.String(maxLength: 50),
                        UserAddress = c.String(maxLength: 50),
                        UserPhone = c.String(maxLength: 15),
                        UserSickDays = c.Int(nullable: false),
                        UserDaysOff = c.Int(nullable: false),
                        UserCreateDate = c.DateTime(nullable: false),
                        UserIsDisable = c.Boolean(nullable: false),
                        JobId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.UserId)
                .ForeignKey("dbo.JobDetail", t => t.JobId, cascadeDelete: true)
                .Index(t => t.JobId);
            
            CreateTable(
                "dbo.JobDetail",
                c => new
                    {
                        JobId = c.Int(nullable: false, identity: true),
                        JobPercent = c.Int(nullable: false),
                        JobDescription = c.Int(nullable: false),
                        JobLevel = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.JobId);
            
            CreateTable(
                "dbo.LogInOut",
                c => new
                    {
                        LogInOutid = c.Int(nullable: false, identity: true),
                        LogInOutUserId = c.String(maxLength: 10),
                        LogInOutDate = c.DateTime(nullable: false),
                        LogInOutEntryDate = c.DateTime(nullable: false),
                        LogInOutEntryTime = c.DateTime(nullable: false),
                        LogInOutExitDate = c.DateTime(nullable: false),
                        LogInOutExitTime = c.DateTime(nullable: false),
                        LogInOutComment = c.String(maxLength: 1000),
                    })
                .PrimaryKey(t => t.LogInOutid);
            
            CreateTable(
                "dbo.RequestsTable",
                c => new
                    {
                        RequestId = c.Int(nullable: false, identity: true),
                        RequestDate = c.DateTime(nullable: false),
                        RequestFreeText = c.String(maxLength: 400),
                    })
                .PrimaryKey(t => t.RequestId);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.Users", new[] { "JobId" });
            DropForeignKey("dbo.Users", "JobId", "dbo.JobDetail");
            DropTable("dbo.RequestsTable");
            DropTable("dbo.LogInOut");
            DropTable("dbo.JobDetail");
            DropTable("dbo.Users");
        }
    }
}
